﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MediaDefinitionAudit.cs" company="DST Nexdox">
//   Copyright (c) DST Nexdox. All rights reserved.
// </copyright>
// <summary>
//   Defines the MediaDefinitionAudit type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Entities
{
  using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.Data.Entity.Spatial;

  [Table("MediaDefinitionAudits")]
  public partial class MediaDefinitionAudit
  {
    public MediaDefinitionAudit()
    {
    }

    public enum MediaDefinitionAuditType
    {
      MailSortSettingUpdated = 1,
      PrintFlagUpdated,
      MediaStockAdded,
      MediaStockRemoved,
      MediaStockStationNumbersUpdated
    }

    [Key]
    public Int32 MediaDefinitionAuditId { get; set; }

    [Required]
    public Int32 MediaDefinitionId { get; set; }

    [Required]
    [StringLength(128)]
    public String UserId { get; set; }

    [Column("AuditType")]
    [Required]
    public Int32 AuditTypeInteger { get; set; }

    [NotMapped]
    public MediaDefinitionAuditType AuditType
    {
      get
      {
        return (MediaDefinitionAuditType)this.AuditTypeInteger;
      }
      set
      {
        this.AuditTypeInteger = (Int32)value;
      }
    }

    [Required]
    public DateTime AuditDate { get; set; }

    [Required]
    public String Details { get; set; }

    public virtual ApplicationUser AspNetUser { get; set; }

    public virtual MediaDefinition MediaDefinition { get; set; }
  }
}
